import React from 'react';
import { Picker, Modal, Toast } from 'antd-mobile';
import 'lib-flexible';
import './inedx.scss';
const alert = Modal.alert;

type Props= {
  history:any,
}


export default class Back extends React.Component<Props>{
  constructor(props:any){
    super(props)
  }
  state = {

  }
  confirm(){
      this.props.history.goBack();
  }

  goHome(){
    alert('', "返回后需重新填写,是否继续?", [
      { text: '取消', onPress: () => console.log('cancel'), style: 'default' },
      {
          text: '确认', onPress: () => {
              this.confirm()
          }
      },
    ]);
  }
  render () {
    return (
    <div className="backhome flex alignitems" onClick={()=>this.goHome()}>返回首页</div>
    );
  }
}
